<template>
    <div> 
       <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newList" :key="item.id">
					<router-link :to="'/home/newsinfo/' + item.id">
						<img class="mui-media-object mui-pull-left" :src="item.img">
						<div class="mui-media-body">
							<h1>{{ item.title }}</h1>
							<p class='mui-ellipsis'>
                                <span>{{ item.add_time | dateFormat }}</span>
                                <span>点击：{{ item.count }}次</span>
                            </p>
						</div>
					</router-link>
				</li> 
	    </ul>
    </div>
</template>

<script>
import { Toast } from 'mint-ui'

export default {
    data(){
        return {
            newList:[]
        }
    },
    created(){
        this.getNewList()
    },
    methods:{
        getNewList(){
            //  this.$http.get("api/getnewlist").then(result => {
            //     if(result.body.status == 0)
            //     {
            //         this.newList = result.body.message;
            //         Toast("loader success");
            //     }else{
            //         Toast("loader error");
            //     }
            // }); 
            this.newList = [
                {id:1,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:2,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:3,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:4,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:5,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:6,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:7,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:8,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:9,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:10,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:11,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:12,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:13,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:14,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:15,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:16,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:17,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12},
                {id:18,img:'../../images/shuijiao.jpg',title:'幸福',add_time:'2019-03-03 12:22:23',count:12}

            ]
        }
    }
}
</script>


<style lang="scss" scoped>
.mui-table-view{
    .mui-media-body{
        h1{
            font-size: 14px; 
        }
        .mui-ellipsis{
            font-size: 12px; 
            color: blue;
            display: flex;
            justify-content:space-between;
            }
    }
}
</style>

